/*
 * Schedule.java
 *
 * Created on February 22, 2007, 7:52 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package ge.info.domain.schedule;

import ge.ktapestry.propertyselections.IComboItem;

import ge.ktools.StringUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Date;

/**
 * @author Administrator
 */
public class ScheduleType implements java.io.Serializable, IComboItem
{

    private int scheduleTypeID;   
    private int serviceID;
    private String name;
    private String posterCriteria;
    private Date sdate;
    private List<SchedulePlace> schedulePlaces;

    public ScheduleType()
    {
    }

    public boolean equals(Object o)
    {
        if (!(o instanceof ScheduleType))
        {
            return false;
        }
        return this.getScheduleTypeID() == (((ScheduleType) o).getScheduleTypeID());
    }

    public int getScheduleTypeID()
    {
        return scheduleTypeID;
    }

    public void setScheduleTypeID(int scheduleTypeID)
    {
        this.scheduleTypeID = scheduleTypeID;
    }

    public int getServiceID()
    {
        return serviceID;
    }

    public void setServiceID(int serviceID)
    {
        this.serviceID = serviceID;
    }

    public String getScheduleName()
    {
        return name;
    }

    public void setScheduleName(String name)
    {
        this.name = name;
    }

    public List<SchedulePlace> getSchedulePlaces()
    {
        if (schedulePlaces == null)
        {
            schedulePlaces = new ArrayList<SchedulePlace>();
        }
        return schedulePlaces;
    }

    public void setSchedulePlaces(List<SchedulePlace> schedulePlaces)
    {
        this.schedulePlaces = schedulePlaces;
    }

    public String getUniqueID()
    {
        return String.valueOf(scheduleTypeID);
    }

    public String getDisplayName()
    {
        return name;
    }

    /**
     * @return the posterCriteria
     */
    public String getPosterCriteria()
    {
        return posterCriteria;
    }

    /**
     * @param posterCriteria the posterCriteria to set
     */
    public void setPosterCriteria(String posterCriteria)
    {
        this.posterCriteria = posterCriteria;
    }

    public Date getSdate()
    {
        return sdate;
    }

    public void setSdate(Date sdate)
    {

        this.sdate = sdate;
    }

    public List<String> getPosterCriteriaList()
    {
        return StringUtils.splitString(posterCriteria);
    }
}
